<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<script src="<?php echo SHOP_RESOURCE_SITE_URL.'/js/search_goods.js';?>"></script>
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/wwi-main.css" rel="stylesheet" type="text/css">
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/layout.css" rel="stylesheet" type="text/css">
<style>
body{background: #f5f5f5 !important;}
.text-orange{color:#dab866;}
.indexgoodslist{width: 100% !important;margin: 0 auto ;overflow: auto;height: auto; background:#fff;}
.pagination{background:#fff;padding: 5px 0 20px;}
.s3-module{ background:#fff;}
.history{height: 320px;margin-top:30px;margin-bottom:60px;}
.s3-sidebar-viewed ul li{border:none;}

.wwi-module,.shop_con_list,.history{box-shadow: 3px 3px 5px 0px #e3e3e3;}
.wwi-module{margin-bottom:0;border:none;padding: 25px 30px 0px;}

#wwiSidebarViewed{width: 1160px; margin:0 auto;}
#wwiSidebarViewed .goods-price{font-weight:normal;text-align:center;font-size:14px !important;}
#wwiSidebarViewed .goods-name{text-align:center;height:auto;margin-bottom:20px;}
#wwiSidebarViewed .goods-name a{font-size:14px !important;font-weight:bold;}
.wwi-sidebar-bowers{ height:230px !important;}
.s3-sidebar-viewed ul .goods-pic img{width:160px;height:160px;}
.s3-sidebar-viewed ul .goods-pic a{width:160px !important;height:160px !important;vertical-align:inherit;}
.s3-sidebar-viewed ul .goods-pic{width:160px !important;height:160px !important;}
.s3-sidebar-viewed ul{height: 250px;}
.indexgoodslist .list{
    width: 1140px;height: auto;overflow: auto;margin: 0 auto ;
}
.indexgoodslist .bigimg{
    width: 1200px;
    height: 360px;
    margin-bottom:30px;

}
.indexgoodslist img{
    border:None;
}

.indexgoodslist .sub{
    margin-right: 26px;
    margin-top: 20px;
    width: 265px;
    height: 305px;
    float: left;
    position: relative;

}
.indexgoodslist .sub .biger{
    width: 265px;
    height: 265px;
    overflow:hidden;
    position:relative;
    background: #f5f5f5;
}
.indexgoodslist .sub .biger a{
    width: 1000px;
    height: 1000px;
    position: absolute;
    top: -367.5px;
    left: -367.5px;
    z-index: 999;
    text-align: center;
	line-height:995px;
}
.indexgoodslist .sub img{
	display:inline-block;
    width: 265px;
    height: 265px;
}
.indexgoodslist .sub_title{
    margin-top: 15px;
}
.indexgoodslist p{
    position: absolute;
    left: 367.5px;
    top:602.5px;
    width: 265px;
    height: 30px;
    line-height: 30px;
    font-size: 14px;
    color:#fff;
    background: rgba(0,0,0,0.3);
    margin: 0;
    text-align: center;
    display: none;
}
.indexgoodslist .sub .sub_title .name{
    float: left;font-size: 14px;
}
.indexgoodslist .sub .sub_title .name a{
    color:#000;font-size: 14px; font-weight: bold;
}
.indexgoodslist .sub .sub_title .price{
    float: right;font-size: 14px;color:#dab866;
}
.indexgoodslist .title{
    height: 120px !important;
    height: 145px !important;
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center !important;
    width: inherit !important;
}
.no_results{
    color:#aaa;
    padding: 150px 0;
    text-align: center;
}
.sort{
    background: #f5f5f5;height: auto;overflow: auto;margin: 0 !important;width: 100% !important;
    border-top:1px solid #e7e7e7;
    border-bottom:1px solid #e7e7e7;
}

.sort>a{float: left;font-size: 12px;border-right:1px solid #e7e7e7;height:40px;line-height: 40px;text-align: center;padding:0 20px 0;}
.sort>.func{padding-left:30px;}
.sort>.func:hover{color:#666 !important;}
.sort .hover{background: #fff;}
.sort .hover{padding-right:12px;}
.sort .default{padding-right:20px;}

.inner-banner .col2 img{height: auto !important;}
.subnav{text-align:center;}
.subnav a{
    display: inline-block;
    margin:25px 50px 0;
    padding-top:40px;
    background-repeat: no-repeat;
    background-position: center -60px;
    color:#999999;
}
.subnav .btn_1{background-image:url('/html/images/subnav_1.png')}
.subnav .btn_2{background-image:url('/html/images/subnav_2.png')}
.subnav .btn_3{background-image:url('/html/images/subnav_3.png')}
.subnav .btn_4{background-image:url('/html/images/subnav_4.png')}
.subnav .btn_5{background-image:url('/html/images/subnav_5.png')}
.subnav .btn_6{background-image:url('/html/images/subnav_6.png')}

.subnav a:hover,.subnav .hover{background-position: top center;color:#dab866; }

.biger a img{
	vertical-align: middle;    
    -webkit-transition: -webkit-transform .2s;
    transition: transform .2s;
	zoom: 1;
	display: inline-block;
    vertical-align: middle;
}
.biger a:hover img{
	-webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
    zoom: 1.05;
}
.biger a:hover p{
	display:block;
}
</style>
<?php
$subnav = array(
    0=>array('','全部商品'),
    1=>array('1062','茶具系列'),
    2=>array('1059','银品生活'),
    3=>array('1058','宗教文化'),
    4=>array('1060','家居摆件'),
    5=>array('1061','皇家饰品'),
    );

 ?>
<div class="wwi-container wrapper" style="margin-bottom:60px;">
    
    
    <div class="wwi-module">
      <div class="title" style="border-bottom: 1px solid #eee;">
        <h3>
          <?php if (!empty($output['show_keyword'])) {?>
          <em><?php echo $output['show_keyword'];?></em>
          <?php }?>
          &nbsp;&nbsp;&nbsp;&nbsp;搜索到<b class="text-orange"><?php echo $output['goods_num'];?></b>件相关商品</h3>
		  
		  
	</div>  
<div class="subnav" style="width:100%;height:110px;margin:0;">
<?php foreach ($subnav as $k => $v) {
    if($v[0]==''){
        if($_GET["gc_id"]){
            echo '<a href="'.urlShop('search','index').'"class="btn_'.($k+1).'">'.$v[1].'</a>';
        }else{
            echo '<a href="'.urlShop('search','index').'"class="hover btn_'.($k+1).'">'.$v[1].'</a>';
        }
    } else {
        if($_GET["gc_id"] == $v[0]){
            echo '<a href="'.replaceParam(array('gc_id' => $v[0])).'" class="hover btn_'.($k+1).'">'.$v[1].'</a>';
        }else{
            echo '<a href="'.replaceParam(array('gc_id' => $v[0])).'" class="btn_'.($k+1).'">'.$v[1].'</a>';
        }
    }

 } ?>
</div>

      
      <?php if (!empty($output['goods_class_array'])) {?>
      <div class="wwi-slide-pp clearfix">
        <ul id="files" class="tree clearfix">
          <?php foreach ($output['goods_class_array'] as $value) {?>
          <li><i class="tree-parent tree-parent-collapsed wwi-slidenone"></i><div class="wwi-slidenone"><a href="<?php echo urlShop('search', 'index', array('cate_id' => $value['gc_id'], 'keyword' => $_GET['keyword']));?>" <?php if ($value['gc_id'] == $_GET['cate_id']) {?>class="selected"<?php }?>><?php echo $value['gc_name']?></a></div>
            <?php if (!empty($value['class2'])) {?>
            <ul class="wwi-two clearfix">
              <?php foreach ($value['class2'] as $val) {?>
              <li><i class="tree-parent tree-parent-collapsed"></i><div class="wwi-slideone"><a href="<?php echo urlShop('search', 'index', array('cate_id' => $val['gc_id'], 'keyword' => $_GET['keyword']));?>" <?php if ($val['gc_id'] == $_GET['cate_id']) {?>class="selected"<?php }?>><?php echo $val['gc_name']?></a></div>
                <?php if (!empty($val['class3'])) {?>
                <ul class="wwi-three">
                  <?php foreach ($val['class3'] as $v) {?>
                  <li class="tree-parent tree-parent-collapsed"><i></i><a href="<?php echo urlShop('search', 'index', array('cate_id' => $v['gc_id'], 'keyword' => $_GET['keyword']));?>" <?php if ($v['gc_id'] == $_GET['cate_id']) {?>class="selected"<?php }?>><?php echo $v['gc_name']?></a></li>
                  <?php }?>
                </ul>
                <?php }?>
              </li>
              <?php }?>
            </ul>
            <?php }?>
          </li>
          <?php }?>
        </ul>
      </div>
    <?php }?>
	  
	  <?php $dl=1;  //dl标记?><?php if((!empty($output['brand_array']) && is_array($output['brand_array'])) || (!empty($output['attr_array']) && is_array($output['attr_array']))){?>
      <div class="content">
        <div class="wwi-module-filter">
          <?php if((isset($output['checked_brand']) && is_array($output['checked_brand'])) || (isset($output['checked_attr']) && is_array($output['checked_attr']))){?>
          <dl nc_type="ul_filter">
            <dt><?php echo $lang['goods_class_index_selected'].$lang['nc_colon'];?></dt>
            <dd class="list">
              <?php if(isset($output['checked_brand']) && is_array($output['checked_brand'])){?>
              <?php foreach ($output['checked_brand'] as $key=>$val){?>
              <span class="selected" nctype="span_filter"><?php echo $lang['goods_class_index_brand'];?>:<em><?php echo $val['brand_name']?></em><i data-uri="<?php echo removeParam(array('b_id' => $key));?>">X</i></span>
              <?php }?>
              <?php }?>
              <?php if(isset($output['checked_attr']) && is_array($output['checked_attr'])){?>
              <?php foreach ($output['checked_attr'] as $val){?>
              <span class="selected" nctype="span_filter"><?php echo $val['attr_name'].':<em>'.$val['attr_value_name'].'</em>'?><i data-uri="<?php echo removeParam(array('a_id' => $val['attr_value_id']));?>">X</i></span>
              <?php }?>
              <?php }?>
            </dd>
          </dl>
          <?php }?>
          <?php if (!isset($output['checked_brand']) || empty($output['checked_brand'])){?>
          <?php if(!empty($output['brand_array']) && is_array($output['brand_array'])){?>
          <dl>
            <dt><?php echo $lang['goods_class_index_brand'].$lang['nc_colon'];?></dt>
            <dd class="list">
              <ul class="wwi-brand-tab" nctype="ul_initial" style="display:none;">
                <li data-initial="all"><a href="javascript:void(0);">所有品牌<i class="arrow"></i></a></li>
                <?php if (!empty($output['initial_array'])) {?>
                <?php foreach ($output['initial_array'] as $val) {?>
                <li data-initial="<?php echo $val;?>"><a href="javascript:void(0);"><?php echo $val;?><i class="arrow"></i></a></li>
                <?php }?>
                <?php }?>
              </ul>
              <div id="ncBrandlist">
                <ul class="wwi-brand-con" nctype="ul_brand">
                  <?php $i = 0;foreach ($output['brand_array'] as $k=>$v){$i++;?>
                  <li data-initial="<?php echo $v['brand_initial']?>" <?php if ($i > 16) {?>style="display:none;"<?php }?>><a href="<?php $b_id = (($_GET['b_id'] != '' && intval($_GET['b_id']) != 0)?$_GET['b_id'].'_'.$k:$k); echo replaceParam(array('b_id' => $b_id));?>">
                    <?php if ($v['show_type'] == 0) {?>
                    <img src="<?php echo brandImage($v['brand_pic']);?>" alt="<?php echo $v['brand_name'];?>" /> <span>
                    <?php  echo $v['brand_name'];?>
                    </span>
                    <?php } else { echo $v['brand_name'];?>
                    <?php }?>
                    </a></li>
                  <?php }?>
                </ul>
              </div>
            </dd>
            <?php if (count($output['brand_array']) > 16){?>
            <dd class="all"><span nctype="brand_show"><i class="icon-angle-down"></i><?php echo $lang['goods_class_index_more'];?></span></dd>
            <?php }?>
          </dl>
          <?php $dl++;}?>
          <?php }?>
          <?php if(!empty($output['attr_array']) && is_array($output['attr_array'])){?>
          <?php $j = 0;foreach ($output['attr_array'] as $key=>$val){$j++;?>
          <?php if(!isset($output['checked_attr'][$key]) && !empty($val['value']) && is_array($val['value'])){?>
          <dl>
            <dt><?php echo $val['name'].$lang['nc_colon'];?></dt>
            <dd class="list">
              <ul>
                <?php $i = 0;foreach ($val['value'] as $k=>$v){$i++;?>
                <li <?php if ($i>10){?>style="display:none" nc_type="none"<?php }?>><a href="<?php $a_id = (($_GET['a_id'] != '' && $_GET['a_id'] != 0)?$_GET['a_id'].'_'.$k:$k); echo replaceParam(array('a_id' => $a_id));?>"><?php echo $v['attr_value_name'];?></a></li>
                <?php }?>
              </ul>
            </dd>
            <?php if (count($val['value']) > 10){?>
            <dd class="all"><span nc_type="show"><i class="icon-angle-down"></i><?php echo $lang['goods_class_index_more'];?></span></dd>
            <?php }?>
          </dl>
          <?php }?>
          <?php $dl++;} ?>
          <?php }?>
        </div>
      </div><?php }?>
    </div>

    <!-- 分类下的推荐商品 -->
    <div class="shop_con_list" id="main-nav-holder">
	
	<div class="sort">

    <a class="func" href="javascript:void(0)">排序方式：</a>
    <a class="default <?php if(!$_GET['key']){?>hover<?php }?>" href="<?php echo dropParam(array('order', 'key'));?>">默认排序</a>

	<a class="time <?php if($_GET['key']=="2"){?>hover<?php }?>" href="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '2') ? replaceParam(array('key' => '2', 'order' => '1')):replaceParam(array('key' => '2', 'order' => '2')); ?>">最新上架<?php if($_GET['key']=="2"){?><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/i-btn-arr<?php echo $_GET['order'] == 1 ? '2' : '1';?>.png" alt=""><?php }?></a>

    <a class="price <?php if($_GET['key']=="3"){?>hover<?php }?>" href="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '3') ? replaceParam(array('key' => '3', 'order' => '1')):replaceParam(array('key' => '3', 'order' => '2')); ?>">价格排序<?php if($_GET['key']=="3"){?><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/i-btn-arr<?php echo $_GET['order'] == 1 ? '2' : '1';?>.png" alt=""><?php }?></a>

	</div>
	

	  
      <!-- 商品列表循环  -->
      <div class="indexgoodslist">
      <?php require_once (BASE_TPL_PATH.'/home/goods.squares.php');?>
      </div>
   
        <div class="pagination tc"> <?php echo $output['show_page']; ?> </div>

    </div>
  <div class="clear"></div>


<div id="gc_goods_recommend_div" ></div>
 <!-- E 推荐展位 -->
<!--<div class="wwi-module">--><?php //echo loadadv(37,'html');?><!--</div>-->
     
        <!-- S 推荐展位 -->
    <div nctype="booth_goods" class="s3-module" style="display:none;"> </div>

<!-- 猜你喜欢 --><div id="guesslike_div" style="width:1200px;"></div>  
<!-- 最近浏览 --><?php if(!empty($output['viewed_goods']) && is_array($output['viewed_goods'])){?>
<div class="s3-module history">


<div class="title"><h3><b style="font-size:16px;margin-left:20px;float:left;">最近浏览</b>

<a href="<?php echo SHOP_SITE_URL;?>/index.php?act=member_goodsbrowse&op=list" class="fr" style="margin-right:20px;color:##999;">查看全部记录</a>
</h3>
</div>


<div class="content">

<div class="s3-sidebar-viewed ps-container" id="wwiSidebarViewed">
<ul><?php foreach ($output['viewed_goods'] as $k=>$v){?>
<li class="wwi-sidebar-bowers">
	<div class="goods-pic">
		<a href="<?php echo urlShop('goods','index',array('goods_id'=>$v['goods_id'])); ?>" target="_blank">
		<img src="<?php echo thumb($v, 265); ?>" title="<?php echo $v['goods_name']; ?>" alt="<?php echo $v['goods_name']; ?>" >
		</a>
	</div>

	<div class="goods-name"><a href="<?php echo urlShop('goods','index',array('goods_id'=>$v['goods_id'])); ?>" target="_blank"><?php echo $v['goods_name']; ?></a></div>
	<div class="goods-price text-orange" title="商品价格<?php echo $lang['nc_colon'].$lang['currency'].ncPriceFormat($value['goods_promotion_price']);?>">
		<?php echo $lang['currency'];?><?php echo ncPriceFormat($v['goods_promotion_price']); ?>
	</div>
 </li> <?php } ?>
 </ul>
 </div>
 </div>

</div><?php } ?></div></div>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/waypoints.js"></script> 
<script src="<?php echo SHOP_RESOURCE_SITE_URL;?>/js/search_category_menu.js"></script> 
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/fly/jquery.fly.min.js" charset="utf-8"></script> 
<!--[if lt IE 10]>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/fly/requestAnimationFrame.js" charset="utf-8"></script>
<![endif]-->
<script type="text/javascript">
$(function(){
	//列表特效
$(".indexgoodslist .list").each(function(){
    for (var i = 0; i <= $(this).find(".sub").length; i++) {
        if(i%4==0){
            $(this).find(".sub").eq(i-1).css("margin-right","0px")
        }
    }

})

	//浏览历史处滚条
	$('#wwiSidebarViewed').perfectScrollbar({suppressScrollY:true});


});
</script> 
